<?php
require 'menu_atas.php';
?>
<style>
input.error, textarea.error, select.error {
	background-color:#FFFFCC !important;
	border:1px solid #CC0000 !important;
}
label.error {
	color:#CC0000 !important;
	font-family:Arial, Helvetica, sans-serif !important;
	font-size:11px !important;
	padding-left:5px !important;
}
</style>
<?php
$username=$_SESSION['username'];
$sql="select a.*,b.proli as nama_proli,c.agama as nama_agama from tb_pendaftar a left join tb_proli b on a.proli=b.kd_proli
		left join tb_agama c on a.agama=c.id_agama where username='".$username."'";
//echo $sql;
$qry=mysql_query($sql);
$hasil=mysql_fetch_array($qry);
$id_pendaftaran=$hasil['id_pendaftaran'];
?>
  <div id="isi">
  <h2>Daftar Sertifikat</h2>
<?php
$sql="select * from tb_sertifikat where id_pendaftar='".$id_pendaftaran."'";
$qry_sert=mysql_query($sql);

?>

<table id="belang">
<tr>
	<th>No</th>
	<th>Nama Sertifikat</th>
	<th>Jenjang</th>
	<th>Juara</th>
	<th>Daerah</th>
	<th>Aksi</th>
</tr>
<?php
$no=1;
$arr_jenjang=array('internasional'=>'Internasional','nasional'=>'Nasional','provinsi'=>'Provinsi','kabupaten'=>'Kabupaten');
$arr_daerah=array('dalam_kab'=>'Dalam Kabupaten','luar_kab'=>'Luar Kabupaten','luar_prov'=>'Luar Provinsi');
while($hasil_sert=mysql_fetch_array($qry_sert)){
?>
  <tr>
  	<th><?php echo $no;?></th>
	<td><?php echo $hasil_sert['nama_sertifikat']?></td>
	<td><?php echo $arr_jenjang[$hasil_sert['jenjang']]?></td>
	<td><?php echo $hasil_sert['juara']?></td>
	<td><?php echo $arr_daerah[$hasil_sert['status_daerah']]?></td>
	<td><a href="delete_sertifikat.php?id=<?php echo $hasil_sert['id_sertifikat']?>" ><img src="images/delete.png" /></a></td>
  </tr>
<?php
$no++;
}
?>
</table>

 </div>
<?php
require 'footer.php';
?>